//
//  CustomTextView.m
//  Masonry
//
//  Created by weijunjie on 2018/4/10.
//

#import "CustomTextView.h"
@implementation CustomTextView

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.keyboardType = UIKeyboardTypeNumberPad;
        self.tintColor = Color140;
        self.textColor = [UIColor clearColor];
        self.backgroundColor = [UIColor clearColor];
        self.editable = YES;
    }
    return self;
}

- (CGRect)caretRectForPosition:(UITextPosition *)position {
    CGRect originalRect = [super caretRectForPosition:position];
    originalRect.size.width = 0.5;
    originalRect.origin.y = 17;
    originalRect.size.height = 22;
    originalRect.origin.x = kCodePadding + (kCodeViewWidth - 0.5) * 0.5 + self.index * (kCodeMarginLeft + kCodeViewWidth);
    return originalRect;
}

@end
